// Unintentional assignment
let x;
if (x = 0) {
  const b = 1;
}

// Practical example that is similar to an error
const setHeight = function (someNode) {
  do {
    someNode.height = "100px";
  } while (someNode = someNode.parentNode);
}

var x; if (x = 0) { var b = 1; }
var x; while (x = 0) { var b = 1; }
var x = 0, y; do { y = x; } while (x = x + 1);
var x; if ((x) = (0));